/*
package com.rules.admin.utils;

import com.alibaba.fastjson.JSON;
import com.gillion.grule.client.components.DubboComponent;
import com.gillion.grule.client.core.Context;
import com.gillion.grule.client.utils.ContextHolder;
import com.gillion.grule.manager.entity.TestLogModel;
import com.gillion.grule.manager.service.TestLogService;
import com.gillion.grule.manager.unit.mock.ComponentMock;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.Map;

public class Tools<T> extends com.gillion.grule.client.utils.Tools {
   private static final Logger logger = LoggerFactory.getLogger(Tools.class);

   public static <T> T executeDubbo(Context context, Object dubboName, Object... object) {
      System.out.println("------" + object.length);
      DubboComponent dubboComponent = (DubboComponent)ComponentMock.getMockComponent("Dubbo");
      if (dubboComponent == null) {
         logger.info("无mock配置，调用真正实现方法");
         return com.gillion.grule.client.utils.Tools.executeDubbo(context, dubboName, object);
      } else {
         Map map = Maps.newConcurrentMap();
         List<Object> paramsMap = Lists.newArrayList();
         map.put("dubboName", dubboName);
         map.put("params", paramsMap);
         map.put("type", "edit");
         Object[] var6 = object;
         int var7 = object.length;

         for(int var8 = 0; var8 < var7; ++var8) {
            Object str = var6[var8];
            paramsMap.add(str);
         }

         Object result = null;
         Object obj = dubboComponent.execute(JSON.toJSONString(map), context);
         if (obj != null) {
            if ((!obj.toString().startsWith("{") || !obj.toString().endsWith("}")) && (!obj.toString().startsWith("[") || !obj.toString().endsWith("]"))) {
               result = obj;
            } else {
               result = JSON.parse(obj.toString());
            }
         }
         //TODO

         return (T) result;
      }
   }

   public static void save(String groupId, String artifactId, Long ruleId, String testId, int deductionNo) {
      TestLogModel t = new TestLogModel();
      t.setGroupid(groupId);
      t.setArtifactid(artifactId);
      t.setRuleid(ruleId);
      t.setDeductionno(deductionNo);
      t.setTestid(testId);
      TestLogService testLogService = (TestLogService)ContextHolder.getBean(TestLogService.class);
      testLogService.save(t);
   }
}
*/
